<?php

namespace App\Http\Requests\AuthRequests;

use Illuminate\Foundation\Http\FormRequest;

class EmailFindRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'email_code' => [
                'required',
                // 'emailCode:' . $this->input('email')
            ],
            'password' => ['required', 'min:6', 'max:18'],
            'password1' => ['required', 'min:6', 'max:18'],
        ];
    }

    public function messages()
    {
        return [
            'email.required' => __('账号必填'),
            'email.unique' => __('账号已注册'),
            'email.max' => __('账号至多20位'),
            'email_code.required' => __('验证码必填'),
            'password.required' => __('交易密码必填'),
            'password.min' => __('交易密码至少6位'),
            'password.max' => __('交易密码至多18位'),
            'password1.required' => __('交易密码必填'),
            'password1.min' => __('交易密码至少6位'),
            'password1.max' => __('交易密码至多18位'),
        ];
    }
}
